package com.yaorange.nongjt.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yaorange.nongjt.mapper.NjtAgriculturalProductCertificationMapper;
import com.yaorange.nongjt.domain.NjtAgriculturalProductCertification;
import com.yaorange.nongjt.service.INjtAgriculturalProductCertificationService;

/**
 * 合格证打印列Service业务层处理
 * 
 * @author hzliu
 * @date 2025-09-27
 */
@Service
public class NjtAgriculturalProductCertificationServiceImpl implements INjtAgriculturalProductCertificationService 
{
    @Autowired
    private NjtAgriculturalProductCertificationMapper njtAgriculturalProductCertificationMapper;

    /**
     * 查询合格证打印列
     * 
     * @param id 合格证打印列主键
     * @return 合格证打印列
     */
    @Override
    public NjtAgriculturalProductCertification selectNjtAgriculturalProductCertificationById(Long id)
    {
        return njtAgriculturalProductCertificationMapper.selectNjtAgriculturalProductCertificationById(id);
    }

    /**
     * 查询合格证打印列列表
     * 
     * @param njtAgriculturalProductCertification 合格证打印列
     * @return 合格证打印列
     */
    @Override
    public List<NjtAgriculturalProductCertification> selectNjtAgriculturalProductCertificationList(NjtAgriculturalProductCertification njtAgriculturalProductCertification)
    {
        return njtAgriculturalProductCertificationMapper.selectNjtAgriculturalProductCertificationList(njtAgriculturalProductCertification);
    }

    /**
     * 新增合格证打印列
     * 
     * @param njtAgriculturalProductCertification 合格证打印列
     * @return 结果
     */
    @Override
    public int insertNjtAgriculturalProductCertification(NjtAgriculturalProductCertification njtAgriculturalProductCertification)
    {
        return njtAgriculturalProductCertificationMapper.insertNjtAgriculturalProductCertification(njtAgriculturalProductCertification);
    }

    /**
     * 修改合格证打印列
     * 
     * @param njtAgriculturalProductCertification 合格证打印列
     * @return 结果
     */
    @Override
    public int updateNjtAgriculturalProductCertification(NjtAgriculturalProductCertification njtAgriculturalProductCertification)
    {
        return njtAgriculturalProductCertificationMapper.updateNjtAgriculturalProductCertification(njtAgriculturalProductCertification);
    }

    /**
     * 批量删除合格证打印列
     * 
     * @param ids 需要删除的合格证打印列主键
     * @return 结果
     */
    @Override
    public int deleteNjtAgriculturalProductCertificationByIds(Long[] ids)
    {
        return njtAgriculturalProductCertificationMapper.deleteNjtAgriculturalProductCertificationByIds(ids);
    }

    /**
     * 删除合格证打印列信息
     * 
     * @param id 合格证打印列主键
     * @return 结果
     */
    @Override
    public int deleteNjtAgriculturalProductCertificationById(Long id)
    {
        return njtAgriculturalProductCertificationMapper.deleteNjtAgriculturalProductCertificationById(id);
    }


    /**
     * 按ID分组查询quantity总和，并获取对应的产品名称
     *
     * @return 分组统计结果
     */
    @Override
    public List<NjtAgriculturalProductCertification> getQuantityGroupById()
    {
        return njtAgriculturalProductCertificationMapper.getQuantityGroupById();
    }
}
